<%-- 
    Document   : index
    Created on : 2012-3-26, 22:18:17
    Author     : txdnet
--%>
<%@page import="cn.txdnet.txcms.domain.Infobase"%>
<%@page import="java.util.Map"%>
<%@page import="java.util.HashMap"%>
<%@page import="cn.txdnet.txweb.annotation.validation.Validator"%>
<%@page import="cn.txdnet.txcms.domain.Demo"%>
<%@page import="txdnet.util.DataUtil"%>
<%@page import="cn.txdnet.key.GenId"%>
<%@page import="txdnet.util.coder.Md5"%>
<%@page import="txdnet.util.StaticMark"%>
<%@page import="txdnet.util.FileUtil"%>
<%@page import="cn.txdnet.txweb.utils.*"%>
<%@page import="cn.txdnet.txcms.service.CatalogsService"%>
<%@page import="cn.txdnet.txcms.domain.Catalogs"%>
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" buffer="16kb" session="true" autoFlush="true"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="Keywords" content="" />
<meta name="description" content="" />
<title></title>
<script type="text/javascript" src=""></script>
<link type="text/css" rel="stylesheet" href="" />
</head>
<body>

<%
long t1 =System.currentTimeMillis();
 String url = "/asf/sadf/asdf_sdf_do.dsf";
//out.println(Md5.encode("admin"));
        Map p = new HashMap();
        p.put("id", new String[]{"12366", "sf"});
        p.put("tel", new String[]{"13916810773", "sf"});
        p.put("age", new String[]{"27", "sf"});
        p.put("price", new String[]{"23.87", "sf"});
        p.put("desc", new String[]{"ghsdfsf", "sf"});
        p.put("desc1", new String[]{"ghsdfsf", "sf"});
        p.put("mount", new String[]{"12311", "sf"});
        String pJson = JsonUtil.toJSONString(p);
        out.println(pJson);
       Demo demo = BeanUtil.parseMapToBean(Demo.class, p);
 try{
   
   out.println(demo.validate());
  }catch(Exception e){
    out.println(e.toString());
 }
    out.println(JsonUtil.toJSONString(demo));
    out.println( "<br/>" + demo.getMount() );
    String c_v = RequestUtil.getCookieValue(request, "UUSID");
    if(c_v==null){
    String v = GenId.makeRndChr(8).concat(GenId.makeUUID()).concat(Long.toHexString(DataUtil.getMs()));
    RequestUtil.setCookie(request, response, "UUSID", v, 1000*60);
    }else{
    out.println("<br/>sUUSID:".concat(c_v) );
    }
    out.println("<br/>times: "+ (System.currentTimeMillis() - t1));
    out.println("<br/>");
     Infobase info = new Infobase();
     info.setInfoid(111111111L);
     info.setCid(1);
     info.setTitle("asfasf");
     info.setCtp("333-333-");
     out.println("<br/>"+info.validate());
     out.println(JsonUtil.toJSONString(info));
     
     out.println(request.getQueryString());
%>
</body>
</html>
